<template>
    <div class="subjectZero">

        <Row type="flex" justify="space-between" class="zero">
            <Col span="4"
                 v-for="(obj,i) in subjectList"
                 :key="obj.subjectId">
            <img :src="obj.subPic" @click="goDetails(obj)">
            </Col>
        </Row>
    </div>
</template>

<script>
    export default {
        name: "",
        components: {},
        data() {
            return {
                subjectList: [],
                subject: {
                    //主键Id
                    subjectId: "",
                    //科目名称
                    subName: "",
                    //课程图片
                    subPic: "",
                    //课程社区url
                    subCommunityUrl: "",
                    //课程教师
                    subTeacher: "",
                    //qq群
                    qqGroup: "",
                    //课程简介
                    subIntroduction: "",
                    //课时总数
                    subTotal: "",
                    //课程评分，0-5，默认5分
                    subScore: "",
                    //是否vip课程 默认0,非vip课程
                    vip: "",
                    //显示排序
                    showOrder: "",
                    //状态  1在用  0失效
                    status: "",
                    //创建人id
                    createUser: "",
                    //创建时间
                    createTime: "",
                }
            }
        },
        methods: {
            selectSubjectZeroList: function () {
                this.axios.get(`/course/web-subject/subjectZero`)
                    .then((data) => {
                        if (data.code == 200) {
                            this.subjectList = data.data
                        }
                    })
            },
            goDetails:function (obj) {
                //跳转
                let {href} = this.$router.resolve({
                    name: "CourseList",
                    query: {
                        sid: obj.subjectId
                    }
                });
                window.open(href, '_blank');
            }
        },
        mounted() {
            this.selectSubjectZeroList()
        }
    }
</script>

<style scoped>
    .subjectZero {
        height: 134px;
        padding: 10px 0px 0px 0px;
    }

    .zero {
    }

    .zero img {
        width: 210px;
        height: 114px;
    }

    .zero img:hover {
        width: 222px;
        height: 126px;
        margin: -6px 0px 0px -6px;
        box-shadow: 1px 2px 10px 2px #777;
    }
</style>